package ro.bluecube.admlocal.gui.commons;

import java.util.ArrayList;

import javax.swing.table.AbstractTableModel;

public abstract class SortTableModel extends AbstractTableModel {
	private static final long serialVersionUID = 1L;
	
	public SortTableModel(ArrayList tableData) {
		super();
		this.tableData = tableData;
	}

	private ArrayList tableData;
	private ArrayList columnNames;

	public int getRowCount() {
		return tableData.size();
	}

	public ArrayList getTableData() {
		return tableData;
	}

	public String getColumnName(int column) {
		return (String) columnNames.get(column);
	}

	public int getColumnCount() {
		return columnNames.size();
	}
	

	public abstract Object getValueAt(int rowIndex, int columnIndex);
	
	public void replaceDatas(ArrayList tableData){
		this.tableData = tableData;
		fireTableDataChanged();
	}

	public void setColumnNames(ArrayList columnNames){
		this.columnNames = columnNames;
	}
}
